import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class TankClient extends Frame {
    // 重写 Paint 方法,画出代表坦克的实现圆
    public void paint(Graphics g) {
        // 取画笔默认颜色
        Color c = g.getColor();
        // 设置画笔颜色
        g.setColor(Color.red);
        // 画实心圆，参数分别为坐标与宽高
        g.fillOval(50, 50, 30, 30);
        // 恢复现场，画笔设置为默认颜色
        g.setColor(c);
    }

    public void lauchFrame() {
        this.setLocation(300, 100);
        this.setSize(800, 600);
        this.setTitle("TankWar");

        this.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });

        this.setResizable(false);
        // 设置窗口背景颜色为绿
        this.setBackground(Color.green);
        setVisible(true);
    }

    public static void main(String[] args) {
        TankClient tc = new TankClient();
        tc.lauchFrame();
    }

}